/* Firefox userChrome.css tweaks ********************************************************/
/* Github: https://github.com/aris-t2/customcssforfx ************************************/
/****************************************************************************************/


/* NOTE  ********************************************************************************/
/* Variables are set inside '.\config\' folders CSS files, if complete package is used! */

:root {
  --bookmark_items_lines: 1 !important; /* override multiple bookmark lines option */
  --addonbar_height: 25px;
}

/* move bookmarks toolbar to bottom + style bookmarks toolbar */
#main-window:not([chromehidden*="toolbar"]) #navigator-toolbox #PersonalToolbar {
  -moz-window-dragging: no-drag;
  display: flex !important;
  position: fixed !important;
  bottom: 0 !important;
  width: 100% !important;
  height: var(--addonbar_height) !important;
  padding-inline-start: 1px !important;
  padding-inline-end: 1px !important;
  border-top: 1px solid var(--toolbox-border-bottom-color) !important;
  z-index: 1 !important;
}

:root[lwtheme] #navigator-toolbox > #PersonalToolbar {
  background-repeat: no-repeat !important;
  background-position: bottom left !important;
  background-color: var(--toolbar-bgcolor) !important;
  background-image: var(--lwt-header-image) !important;
}

/* free some space below content *//*
#main-window:not([chromehidden*="toolbar"]):not([sizemode="fullscreen"]) #browser-bottombox  {
  margin-bottom: calc( var(--addonbar_height) - 1px);
}

/* hide this projects custom bookmarks label, if used */
#main-window[sizemode="fullscreen"] #PersonalToolbar #bookmarks-menu-button::after {
  visibility: collapse !important;
  display: none !important;
}

#PersonalToolbar toolbarspring {
  display: flex !important;
  min-width: unset !important;
  width: inherit !important;
  max-width: unset !important;
}

#main-window[customizing] #PersonalToolbar toolbarspring {
  display: block !important;
  min-width: 40px !important;
  width: auto !important;
  max-width: 112px !important;
}

/* remove animations */
#tracking-protection-icon-box[active][animate] #tracking-protection-icon-animatable-image,
#reload-button:not([displaystop]) > .toolbarbutton-animatable-box > .toolbarbutton-animatable-image,
#reload-button[displaystop] + #stop-button > .toolbarbutton-animatable-box > .toolbarbutton-animatable-image {
  animation-duration: 0ms !important;
}
#tracking-protection-icon-animatable-box,
#reload-button > .toolbarbutton-animatable-box,
#stop-button > .toolbarbutton-animatable-box {
  visibility: hidden !important;
}
#tracking-protection-icon-box:not([hasException])[active][animationsenabled] > #tracking-protection-icon {
  display: block !important;
}

/* bookmarks item box width */
#PersonalToolbar #personal-bookmarks {
  min-width: 40px !important;
  width: auto !important;
  max-width: 50vw !important;
}

 /* override multiple bookmark lines option */
#personal-bookmarks #PlacesToolbar .chevron{
  visibility: visible !important;
}

/* override default settings */
#main-window #navigator-toolbox > #PersonalToolbar {
  min-height: unset !important;
  padding-top: 0px !important;
  padding-bottom: 0px !important;
}

/* adjust button badges */
#PersonalToolbar toolbarbutton .toolbarbutton-badge {
  margin-inline-end: -1px !important;
  margin-top: -4px !important;  
  padding: 1px !important;
  min-width: unset !important;
  font-size: 9px !important;
}

#main-window:not([chromehidden*="toolbar"]) #navigator-toolbox > #PersonalToolbar {
  border-top: 1px solid rgba(204,204,204,0.8) !important;
}

#tracking-protection-icon-animatable-box {
  visibility: inherit !important;
}

#PersonalToolbar .toolbaritem-combined-buttons {
  margin-inline: 0px !important;
}

/*
#PersonalToolbar .toolbarbutton-1 {
  margin: 0px !important; 
}

#PersonalToolbar toolbarbutton {
  padding: 0px !important;
}
/*
#PersonalToolbar .toolbarbutton-1 {
  --toolbarbutton-inner-padding: 1px !important;
  --toolbarbutton-outer-padding: 0px !important;
}*/

#PersonalToolbar #bookmarks-menu-button {
  -moz-box-align: center !important;
  align-items: center !important;
}

#main-window:not([inDOMFullscreen="true"],[sizemode="fullscreen"]) #browser,
#main-window:not([inDOMFullscreen="true"],[sizemode="fullscreen"]) #customization-container {
  margin-bottom: var(--addonbar_height) !important; 
}

#PersonalToolbar .toolbarbutton-1 {
  margin-block: 0px !important; 
}

#navigator-toolbox {
  z-index: 3 !important;
}



/*************************/

#main-window:not([customizing]) #nav-bar:has(#personal-bookmarks) {
  padding-bottom: 26px !important;
}

/* reduce maximum width of location bar and search bar on navigation toolbar */
#main-window:not([customizing]) #nav-bar:has(#personal-bookmarks) :is(#urlbar-container, #urlbar, #search-container, #searchbar)  {
  min-width: 50px !important;
}

/* move bookmarks to empty space below navigation toolbar, if on navigation toolbar */
#main-window:not([customizing]) #nav-bar:has(#personal-bookmarks) #personal-bookmarks {
  position: absolute !important;
  display: block !important;
  /*bottom: 0px !important;*/
  min-width: 0 !important;
  width: auto !important;
  max-width: 100vw !important;
}

#main-window:not([customizing]) #nav-bar:has(#personal-bookmarks) #personal-bookmarks {
  margin-top: 37px !important;	
}

#main-window:not([customizing])[uidensity="compact"] #nav-bar:has(#personal-bookmarks) #personal-bookmarks {
  margin-top: 32px !important;
}

#main-window:not([customizing])[uidensity="touch"] #nav-bar:has(#personal-bookmarks) #personal-bookmarks {
 margin-top: 41px !important;
}

/* reduce size of bookmarks 'more bookmarks' menu chevron and remove its background color on navigation toolbar */
#nav-bar:has(#personal-bookmarks) #personal-bookmarks #PlacesChevron .toolbarbutton-icon {
  min-width: 0px !important;
  min-height: 0px !important;
  width: 16px !important;
  height: 16px !important;
  padding: 0 !important;
  margin: 0 !important;
  background: unset !important;
  box-shadow: unset !important;
}

/* set minimum height for bookmarks, when on navigation toolbar */
#nav-bar:has(#personal-bookmarks) #personal-bookmarks toolbarbutton.bookmark-item:not(.subviewbutton) {
  min-height: 24px !important;
}

/* adjustments */
#nav-bar:has(#personal-bookmarks) #personal-bookmarks {
  min-width: 40px !important;
  width: auto !important;
  max-width: 50vw !important;
}

/* workaround for megabar_expanding_breakout_disabled.css */
#main-window #nav-bar:has(#personal-bookmarks) #urlbar[breakout],
#main-window #nav-bar:has(#personal-bookmarks) #urlbar[breakout][breakout-extend] {
  top: calc(0px + ((var(--urlbar-container-height,--urlbar-toolbar-height) - var(--urlbar-height)) / 2)) !important;
}

#nav-bar:has(#personal-bookmarks) #personal-toolbar-empty-description,
#nav-bar:has(#personal-bookmarks) #personal-bookmarks toolbarbutton.bookmark-item:not(.subviewbutton) {
  padding: 0 2px !important; 
}
